package com.hh.designPrinciples.CompositeReusePrinciple.right;

/**
 * @author huangh
 * @since 2019/11/19
 */
public class Test {
    public static void main(String[] args) {
        ProductDao productDao = new ProductDao();
        productDao.setDbConnection(new MysqlDBConnection());
//        productDao.setDbConnection(new PostgreesqlDBConnection());
        productDao.addProduct();
        //组合，一对一，强依赖。符合开闭原则，也符合里氏替换原则。随意替换数据源
    }
}
